package org.filecollector.msgcontroller.requests;

import com.google.gson.annotations.SerializedName;
import lombok.NonNull;
import com.google.gson.Gson;

public record SyncRequestMessage(
        @SerializedName("operation_id") @NonNull Long operationID,
        @SerializedName("request") @NonNull RequestMessage requestMessage
) {
    static Gson gsonParser = new Gson();

    public static SyncRequestMessage deserialize(String json) {
        return gsonParser.fromJson(json, SyncRequestMessage.class);
    }

    public String serialize() {
        return gsonParser.toJson(this);
    }
}
